var EXPORTED_SYMBOLS = ["DMS_SendLink"];

DMS_SendLink = function(){

};

Components.utils.import("resource://SynoLoader/Command.js");  
Components.utils.import("resource://SynoLoader/Util.js");  
Components.utils.import("resource://SynoLoader/DMS_Commando/DMS_Connect.js"); 
Components.utils.import("resource://SynoLoader/Notification.js"); 

DMS_SendLink = new Command();
DMS_SendLink.constructor = DMS_SendLink;
DMS_SendLink.link="";
DMS_SendLink.show_not="";
DMS_SendLink.start_dlm="";

DMS_SendLink.onsuccess	= function(http_request)
{
  	var mpInfo = JSON.parse(http_request.responseText); 
	if (mpInfo.success == false)
	{
		Util.log("Send Link Faild!\n" + mpInfo.errno.section +" : " +mpInfo.errno.key);  
		DMS_Connect.send();
	}
	else    
	{
		Util.log("Send Link: "+this.link);
		Notification.show("Send Link", this.link);
		Notification.showDownlaodManager();
	}	
};

 
DMS_SendLink.setParameter= function(link)
{
	this.link=link;
	DMS_SendLink.parameter='urls=%5B%22'+ encodeURIComponent(link) + '%22%5D&action=add_url_task';
};



